# -*- coding:utf8 -*- #
# -----------------------------------------------------------------------------------
# ProjectName:  smart-meter-iot-test
# FileName:     planeData.py
# Author  :
# Datetime:     2023/4/7 23:46
# Description：4G面板数据随机构建
# -----------------------------------------------------------------------------------
import random

from common.util.timeUtil.timeUtil import get_now_time


class PanelData:
    # 用水增量
    @staticmethod
    def panel_increment():
        nowNours = int(get_now_time(2))
        # 夜晚时间
        nighTime1 = random.randint(19, 23)
        nightTime2 = random.randint(8, 10)
        # 不上报
        doNoReport = random.randint(1, 10)
        panelIncrement = 0
        if doNoReport > 3:
            if nowNours >= nighTime1 or nowNours <= nightTime2:
                panelIncrement = random.randint(10, 30)
            else:
                panelIncrement = random.randint(1, 10)
        else:
            panelIncrement = panelIncrement
        return panelIncrement


if __name__ == '__main__':
    wd = PanelData()
    sumIncrement = 0
    for i in range(24):
        panelIncrement = wd.panel_increment()
        print(f"第{i}次:{panelIncrement}")
        sumIncrement += panelIncrement
    print(f"累计: {sumIncrement}")

